﻿using System;

namespace Terraria.World.Generation
{
	// Token: 0x02000086 RID: 134
	public static class Conditions
	{
		// Token: 0x02000087 RID: 135
		public class IsTile : GenCondition
		{
			// Token: 0x06000A0B RID: 2571 RVA: 0x0000ADE9 File Offset: 0x00008FE9
			public IsTile(params ushort[] types)
			{
				this._types = types;
			}

			// Token: 0x06000A0C RID: 2572 RVA: 0x003E5854 File Offset: 0x003E3A54
			protected override bool CheckValidity(int x, int y)
			{
				if (GenBase._tiles[x, y].active())
				{
					for (int i = 0; i < this._types.Length; i++)
					{
						if (GenBase._tiles[x, y].type == this._types[i])
						{
							return true;
						}
					}
				}
				return false;
			}

			// Token: 0x04000EA3 RID: 3747
			private ushort[] _types;
		}

		// Token: 0x02000088 RID: 136
		public class Continue : GenCondition
		{
			// Token: 0x06000A0D RID: 2573 RVA: 0x0000ADF8 File Offset: 0x00008FF8
			protected override bool CheckValidity(int x, int y)
			{
				return false;
			}
		}

		// Token: 0x02000089 RID: 137
		public class IsSolid : GenCondition
		{
			// Token: 0x06000A0F RID: 2575 RVA: 0x0000AE03 File Offset: 0x00009003
			protected override bool CheckValidity(int x, int y)
			{
				return GenBase._tiles[x, y].active() && Main.tileSolid[(int)GenBase._tiles[x, y].type];
			}
		}

		// Token: 0x0200008A RID: 138
		public class HasLava : GenCondition
		{
			// Token: 0x06000A11 RID: 2577 RVA: 0x0000AE31 File Offset: 0x00009031
			protected override bool CheckValidity(int x, int y)
			{
				return GenBase._tiles[x, y].liquid > 0 && GenBase._tiles[x, y].liquidType() == 1;
			}
		}
	}
}
